import 'package:flutter/material.dart';

main() {
  // runApp(MaterialApp(theme: ThemeData.light(), home: Page0())); // 默认
  // runApp(MaterialApp(theme: ThemeData.dark(), home: Page0()));
  // runApp(MaterialApp(
  //     theme: ThemeData(colorScheme: ColorScheme.light(), useMaterial3: true),
  //     home: Page0()));
  runApp(MaterialApp(
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: Page0()));
}

class Page0 extends StatefulWidget {
  const Page0({super.key});

  @override
  State<StatefulWidget> createState() => _Page0State();
}

class _Page0State extends State<Page0> {
  var controllerForAcc = TextEditingController();
  var controllerForPasswd = TextEditingController();

  @override
  Widget build(BuildContext context) {
    /**
     * 示例页面
     */
    return Scaffold(
      // 应用栏
      appBar: AppBar(
        title: const Text('SQFLITE'), // 标题
      ),
      body: Center(
          child: Column(
        children: [
          Container(
              child: Text(
                '芝麻开门',
                style: TextStyle(fontSize: 30),
              ),
              margin: EdgeInsets.symmetric(vertical: 10)),
          TextField(
            controller: controllerForAcc,
            decoration: InputDecoration(
                border:
                    OutlineInputBorder(borderRadius: BorderRadius.circular(10)),
                prefixIcon: Icon(Icons.person),
                labelText: '账号'),
          ),
          Container(
            child: TextField(
              obscureText: true,
              controller: controllerForPasswd,
              decoration: InputDecoration(
                  border: OutlineInputBorder(
                      borderRadius: BorderRadius.circular(10)),
                  prefixIcon: Icon(Icons.password),
                  labelText: '密码'),
            ),
            margin: EdgeInsets.symmetric(vertical: 10),
          ),
          ElevatedButton(onPressed: () {}, child: Text('创建表格')),
          TextButton(onPressed: () {}, child: Text('查询所有数据')),
          ElevatedButton(onPressed: () {}, child: Text('添加数据')),
          IconButton(onPressed: () {}, icon: Icon(Icons.paste)),
          ListTile(
            title: Text('用户设置'),
            trailing: Icon(Icons.keyboard_arrow_right),
          ),
          ListTile(
            title: Text('个人中心'),
            trailing: Icon(Icons.keyboard_arrow_right),
          ),
          ListTile(
            title: Text('余额'),
            trailing: Icon(Icons.keyboard_arrow_right),
          ),
        ],
      )),
      floatingActionButton: FloatingActionButton(
        onPressed: () {},
        child: Icon(Icons.arrow_upward),
      ),
      bottomNavigationBar: BottomNavigationBar(
        items: [
          BottomNavigationBarItem(icon: Icon(Icons.home), label: '首页'),
          BottomNavigationBarItem(icon: Icon(Icons.category), label: '分类'),
          BottomNavigationBarItem(
              icon: Icon(Icons.shopping_cart), label: '购物车'),
        ],
        currentIndex: 0,
      ),
    );
  }
}
